package com.gly091020;

import com.gly091020.config.Oo_ee_a_e_a_config;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer;
import net.fabricmc.api.ClientModInitializer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.random.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.Hashtable;
import java.util.UUID;

public class Oo_ee_a_e_a implements ClientModInitializer {
    // 我知道这个类名一点也不符合规范，但要尊重原作
    public static final String ModID = "oo_ee_a_e_a_fabric";
    public static final Hashtable<UUID, Long> lastSpin = new Hashtable<>();
    public static final Random RANDOM = Random.create();
    public static final SoundEvent OO_EE_A_E_A_FAST = SoundEvent.of(new Identifier(ModID, "oo_ee_a_e_a_fast"));
    public static final SoundEvent OO_EE_A_E_A_SLOW = SoundEvent.of(new Identifier(ModID, "oo_ee_a_e_a_slow"));
    public static Oo_ee_a_e_a_config CONFIG;
    public static final Logger LOGGER = LoggerFactory.getLogger(ModID);
    // 猜猜谁是我？
    public static final String[] OO_EE_A_E_A_ARRAY = {"51121511121", "511215111121", "5112151111121"};
    @Override
    public void onInitializeClient() {
        Registry.register(Registries.SOUND_EVENT, new Identifier(ModID, "oo_ee_a_e_a_fast"), OO_EE_A_E_A_FAST);
        Registry.register(Registries.SOUND_EVENT, new Identifier(ModID, "oo_ee_a_e_a_slow"), OO_EE_A_E_A_SLOW);
        AutoConfig.register(Oo_ee_a_e_a_config.class, JanksonConfigSerializer::new);
        CONFIG = AutoConfig.getConfigHolder(Oo_ee_a_e_a_config.class).getConfig();
        LOGGER.info("玩家名：{}，{}51121", MinecraftClient.getInstance().getSession().getUsername(),
                Arrays.stream(OO_EE_A_E_A_ARRAY).toList()
                .contains(MinecraftClient.getInstance().getSession().getUsername()) ? "是" : "不是");
    }
}
